<template>
  <div>
    <ul>
      <list-item
        v-for="(item, index) of todoData"
        :key="index"
        :item="item"
        @handleItem="handleItem"
      ></list-item>
    </ul>
  </div>
</template>

<script>
import ListItem from "./ListItem.vue";

export default {
  name: "TdList",
  props: {
    todoData: Array,
  },
  components: {
    ListItem,
  },
  methods: {
    handleItem(...args) {
      // console.log("TdList:", ...args);
      //TdList: COMPLETED 1637679544126

      this.$emit("dispatch", ...args);
    },
  },
};
</script>